package com.chinatsp.onlineapp.ui.limit_rule;

import tsp.cn.http.tools.PreferenceUtils;
import tsp.cn.http.tools.T;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;

import com.chinatsp.onlineapp.R;
import com.chinatsp.onlineapp.base.BaseActivity;
import com.chinatsp.onlineapp.presenter.LimitRuleDao;

public class LimitRuleActivity extends BaseActivity implements
		View.OnClickListener {
	private ImageView ivBack;
	private ImageView ivRightRefresh;
	ScrollView mScrollView;
	TextView mRuleInfo;
	TextView mTvLimitCity;
	LimitRuleDao mLimitRuleDao;
	@Override
	public void onRequestSuccess(int requestCode) {
		super.onRequestSuccess(requestCode);
		// 开始更新UI
		//showProgress(false);
	}

	@Override
	public void onRequestFailed(String errorNo, String errorMessage) {
		super.onRequestFailed(errorNo, errorMessage);
		// 开始更新UI
		//showProgress(false);
		
		makeAlertDialog("无网络连接", "无网络连接，点击确定退出", false, true);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_limit_rule);
		initView();
		
		//showProgress(true);
	}

	private void initView() {
		ivBack = (ImageView) findViewById(R.id.iv_back);
		ivRightRefresh = (ImageView) findViewById(R.id.iv_right_refresh);
		mScrollView = (ScrollView) findViewById(R.id.scroll_info);
		mRuleInfo = (TextView) findViewById(R.id.limit_rule_info);
		mTvLimitCity = (TextView) findViewById(R.id.tv_limit_city);
		ivBack.setOnClickListener(this);
		ivRightRefresh.setOnClickListener(this);
		
		String default_city = PreferenceUtils.getPreference("default_city",getString(R.string.default_city));
		mTvLimitCity.setText(default_city);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.iv_back:
			finish();
			break;
		case R.id.iv_right_refresh:
			T.showShort(this, "刷新");
			break;
		}

	}
}
